<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/10/21
 * Time: 9:17
 */

namespace App\GraphQL\InputObject;

use GraphQL\Type\Definition\Type;
use Rebing\GraphQL\Support\InputType;

class UpdateUsersInput extends InputType
{

    protected $attributes = [
        'name' => 'UpdateUsersInput',
        'description' => '批量更新用户input',
    ];


    /*
     查询
        query {
          __type(name: "UpdateUsersInput") {
            name
            kind
            description
            inputFields{
              name
              description
              type {
                kind  //NON_NULL
                name  //string
              }
            }
          }
        }
     */
    public function fields(): array
    {
        return [
            'id' => [
                'type' => Type::nonNull(Type::int()),
                'description' => '用户id'
            ],
            'name' => [
                'type' => Type::nonNull(Type::string()),
                'description' => '用户名支持20个字符',
                'rules' => ['max:20']
            ]

        ];
    }





}
